package wangxiaotao.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class BaseEntity implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    //创建时间  创建时自动插入当前时间
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    //修改时间  修改时默认插入当前时间
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    //逻辑删除
    @TableField(fill = FieldFill.INSERT)
    @TableLogic(value = "true",delval = "false")
    private Boolean isDeleted;
}
